package com.wecon.dianping.service;

import com.wecon.dianping.common.BusinessException;
import com.wecon.dianping.model.User;

import java.io.UnsupportedEncodingException;
import java.security.NoSuchAlgorithmException;

/**
 * @author Weikang  Wang
 * @program: com.wecon.dianping.service
 * @description:
 * @date 2020/3/10 16:57
 */
public interface UserService {

    /**
     * 获取user
     * @param id /
     * @return /
     */
    User getUser(Integer id);

    /**
     * 用户注册
     * @param user /
     * @return /
     * @throws BusinessException /
     * @throws UnsupportedEncodingException /
     * @throws NoSuchAlgorithmException /
     */
    User register(User user) throws BusinessException, UnsupportedEncodingException, NoSuchAlgorithmException;

    /**
     * 用户登录
     * @param telphone 手机号
     * @param password 密码
     * @return /
     */
    User login(String telphone, String password) throws UnsupportedEncodingException, NoSuchAlgorithmException, BusinessException;

    /**
     * 获取用户数量
     * @return /
     */
    Integer countAllUser();
}
